<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.9.1"/>
<title>CSD462 Library Documentation: CSD462::Color Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">CSD462 Library Documentation
   &#160;<span id="projectnumber">1.0</span>
   </div>
   <div id="projectbrief">Computer Graphics</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.9.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="inherits.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><b>CSD462</b></li><li class="navelem"><a class="el" href="class_c_s_d462_1_1_color.html">Color</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-static-methods">Static Public Member Functions</a> &#124;
<a href="#pub-attribs">Public Attributes</a> &#124;
<a href="class_c_s_d462_1_1_color-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">CSD462::Color Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>Encodes a color via additive red, green, and blue chanel values.  
 <a href="class_c_s_d462_1_1_color.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="color_8h_source.html">color.h</a>&gt;</code></p>
<div class="dynheader">
Collaboration diagram for CSD462::Color:</div>
<div class="dyncontent">
<div class="center"><iframe scrolling="no" frameborder="0" src="class_c_s_d462_1_1_color__coll__graph.svg" width="172" height="40"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
</div>
</div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a1bb9403b4f30cd5c5726623ddf79a06f"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_s_d462_1_1_color.html#a1bb9403b4f30cd5c5726623ddf79a06f">Color</a> (float <a class="el" href="class_c_s_d462_1_1_color.html#a96ca65f3c044f4a050bac229dc4bea4b">r</a>=0, float <a class="el" href="class_c_s_d462_1_1_color.html#a8ffcb8836819e028ade97689b9e55964">g</a>=0, float <a class="el" href="class_c_s_d462_1_1_color.html#a3c02c7f76d369fec3d56939c4310c101">b</a>=0, float <a class="el" href="class_c_s_d462_1_1_color.html#aab8b34c598cdf04b45bb2dc519838352">a</a>=1.0)</td></tr>
<tr class="memdesc:a1bb9403b4f30cd5c5726623ddf79a06f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructor.  <a href="#a1bb9403b4f30cd5c5726623ddf79a06f">More...</a><br /></td></tr>
<tr class="separator:a1bb9403b4f30cd5c5726623ddf79a06f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a58b6e12c45e2eca89ac377b17a0a9664"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_s_d462_1_1_color.html#a58b6e12c45e2eca89ac377b17a0a9664">Color</a> (const unsigned char *arr)</td></tr>
<tr class="memdesc:a58b6e12c45e2eca89ac377b17a0a9664"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructor.  <a href="#a58b6e12c45e2eca89ac377b17a0a9664">More...</a><br /></td></tr>
<tr class="separator:a58b6e12c45e2eca89ac377b17a0a9664"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac61ab20732de698e2b8d820e797a41e4"><td class="memItemLeft" align="right" valign="top">std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_s_d462_1_1_color.html#ac61ab20732de698e2b8d820e797a41e4">toHex</a> () const </td></tr>
<tr class="memdesc:ac61ab20732de698e2b8d820e797a41e4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns a hexadecimal string rrggbb encoding this color.  <a href="#ac61ab20732de698e2b8d820e797a41e4">More...</a><br /></td></tr>
<tr class="separator:ac61ab20732de698e2b8d820e797a41e4"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr class="memitem:aa0f1cbb595baac632d6f4e8fa39ce60b"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="class_c_s_d462_1_1_color.html">Color</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_s_d462_1_1_color.html#aa0f1cbb595baac632d6f4e8fa39ce60b">fromHex</a> (const char *s)</td></tr>
<tr class="memdesc:aa0f1cbb595baac632d6f4e8fa39ce60b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Construct a Color object from a hexadecimal (8-bit per component) ASCII string.  <a href="#aa0f1cbb595baac632d6f4e8fa39ce60b">More...</a><br /></td></tr>
<tr class="separator:aa0f1cbb595baac632d6f4e8fa39ce60b"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a>
Public Attributes</h2></td></tr>
<tr class="memitem:a96ca65f3c044f4a050bac229dc4bea4b"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a96ca65f3c044f4a050bac229dc4bea4b"></a>
float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_s_d462_1_1_color.html#a96ca65f3c044f4a050bac229dc4bea4b">r</a></td></tr>
<tr class="memdesc:a96ca65f3c044f4a050bac229dc4bea4b"><td class="mdescLeft">&#160;</td><td class="mdescRight">value of red chanel <br /></td></tr>
<tr class="separator:a96ca65f3c044f4a050bac229dc4bea4b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8ffcb8836819e028ade97689b9e55964"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a8ffcb8836819e028ade97689b9e55964"></a>
float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_s_d462_1_1_color.html#a8ffcb8836819e028ade97689b9e55964">g</a></td></tr>
<tr class="memdesc:a8ffcb8836819e028ade97689b9e55964"><td class="mdescLeft">&#160;</td><td class="mdescRight">value of green chanel <br /></td></tr>
<tr class="separator:a8ffcb8836819e028ade97689b9e55964"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3c02c7f76d369fec3d56939c4310c101"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a3c02c7f76d369fec3d56939c4310c101"></a>
float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_s_d462_1_1_color.html#a3c02c7f76d369fec3d56939c4310c101">b</a></td></tr>
<tr class="memdesc:a3c02c7f76d369fec3d56939c4310c101"><td class="mdescLeft">&#160;</td><td class="mdescRight">value of blue chanel <br /></td></tr>
<tr class="separator:a3c02c7f76d369fec3d56939c4310c101"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aab8b34c598cdf04b45bb2dc519838352"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aab8b34c598cdf04b45bb2dc519838352"></a>
float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_s_d462_1_1_color.html#aab8b34c598cdf04b45bb2dc519838352">a</a></td></tr>
<tr class="memdesc:aab8b34c598cdf04b45bb2dc519838352"><td class="mdescLeft">&#160;</td><td class="mdescRight">value of alpha chanel <br /></td></tr>
<tr class="separator:aab8b34c598cdf04b45bb2dc519838352"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Encodes a color via additive red, green, and blue chanel values. </p>
<p>Each color chanel value is in the range [0,1]. The alpha value defines the transparency of the color and is also in [0,1]. </p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a1bb9403b4f30cd5c5726623ddf79a06f"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">CSD462::Color::Color </td>
          <td>(</td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>r</em> = <code>0</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>g</em> = <code>0</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>b</em> = <code>0</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>a</em> = <code>1.0</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Constructor. </p>
<p>Initialize from component values. By default, alpha is initialized to 1. </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">r</td><td>Value of the red chanel. </td></tr>
    <tr><td class="paramname">g</td><td>Value of the green chanel. </td></tr>
    <tr><td class="paramname">b</td><td>Value of the blue chanel. </td></tr>
    <tr><td class="paramname">a</td><td>Value of the alpha chanel. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a58b6e12c45e2eca89ac377b17a0a9664"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">CSD462::Color::Color </td>
          <td>(</td>
          <td class="paramtype">const unsigned char *&#160;</td>
          <td class="paramname"><em>arr</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Constructor. </p>
<p>Initialize from array of 8-bit component values (RGB only). </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">arr</td><td>Array containing component values. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="aa0f1cbb595baac632d6f4e8fa39ce60b"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="class_c_s_d462_1_1_color.html">Color</a> CSD462::Color::fromHex </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>s</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Construct a Color object from a hexadecimal (8-bit per component) ASCII string. </p>
<p>Since hexademical strings are typically not used to encode alpha values, the alpha is set to 1 (opaque) by default. This method also accepts the string "none", in which case it returns a color value with alpha zero (transparent). </p><dl class="section return"><dt>Returns</dt><dd>Color constructed from the input hex encoding. </dd></dl>

</div>
</div>
<a class="anchor" id="ac61ab20732de698e2b8d820e797a41e4"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">string CSD462::Color::toHex </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns a hexadecimal string rrggbb encoding this color. </p>
<dl class="section return"><dt>Returns</dt><dd>the hexadecimal encoding of the color. </dd></dl>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>lib/<a class="el" href="color_8h_source.html">color.h</a></li>
<li>lib/color.cpp</li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Tue Sep 1 2015 14:30:00 for CSD462 Library Documentation by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.9.1
</small></address>
</body>
</html>
